package com.excellent.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.excellent.system.mapper.SysStuTutorMapper;
import com.excellent.system.domain.SysStuTutor;
import com.excellent.system.service.ISysStuTutorService;
import com.excellent.common.core.text.Convert;

/**
 * 对接导师Service业务层处理
 *
 * @author YYY
 * @date 2021-04-21
 */
@Service
public class SysStuTutorServiceImpl implements ISysStuTutorService
{
    @Autowired
    private SysStuTutorMapper sysStuTutorMapper;

    /**
     * 查询对接导师
     *
     * @param stuSno 对接导师ID
     * @return 对接导师
     */
    @Override
    public SysStuTutor selectSysStuTutorById(String stuSno)
    {
        return sysStuTutorMapper.selectSysStuTutorById(stuSno);
    }

    /**
     * 查询对接导师列表
     *
     * @param sysStuTutor 对接导师
     * @return 对接导师
     */
    @Override
    public List<SysStuTutor> selectSysStuTutorList(SysStuTutor sysStuTutor)
    {
        return sysStuTutorMapper.selectSysStuTutorList(sysStuTutor);
    }

    /**
     * 新增对接导师
     *
     * @param sysStuTutor 对接导师
     * @return 结果
     */
    @Transactional
    @Override
    public int insertSysStuTutor(SysStuTutor sysStuTutor)
    {
        return sysStuTutorMapper.insertSysStuTutor(sysStuTutor);
    }

    /**
     * 修改对接导师
     *
     * @param sysStuTutor 对接导师
     * @return 结果
     */
    @Transactional
    @Override
    public int updateSysStuTutor(SysStuTutor sysStuTutor)
    {
        return sysStuTutorMapper.updateSysStuTutor(sysStuTutor);
    }

    /**
     * 删除对接导师对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Transactional
    @Override
    public int deleteSysStuTutorByIds(String ids)
    {
        sysStuTutorMapper.deleteSysUserByLoginNames(Convert.toStrArray(ids));
        return sysStuTutorMapper.deleteSysStuTutorByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除对接导师信息
     *
     * @param stuSno 对接导师ID
     * @return 结果
     */
    @Override
    public int deleteSysStuTutorById(String stuSno)
    {
        sysStuTutorMapper.deleteSysUserByLoginName(stuSno);
        return sysStuTutorMapper.deleteSysStuTutorById(stuSno);
    }


}
